package cn.zust.ly.play.Exb;

import java.util.Scanner;

/**
 * Created by liy on 2016/12/1.
 */
public class Main {

    static int start = 1;

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][] sj = new int[n][];
        for(int i=0; i<sj.length; i++){
            sj[i] = new int[sj.length-i];
        }

        makeSJ(0, sj);

        for (int i = 0; i < sj.length; i++) {
            for (int j = 0; j < sj[i].length; j++) {
                System.out.printf("%4d",sj[i][j]);
            }
            System.out.println();
        }
    }

    static void makeSJ(int a, int[][] sj){
        if(a > sj.length/2 - 1) return ;
        for(int i = a; i < sj[a].length-a; i++)
            sj[a][i] = start++;start--;
        for(int i = a; i < sj[a].length-a; i++)
            sj[i][sj[i].length-1-a] = start++;start--;
        for(int i = sj[a].length-1-a; i>a; i--)
            sj[i][a] = start++;
        makeSJ(a+1, sj);
    }

}
